package com.ssm.controller;

import com.ssm.utils.JwtTokenUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
//测试类，无意义
@RestController

public class TestController {

    @Autowired
    RedisTemplate redisTemplate;
    @RequestMapping("/test/login")
    public String login(){
        JwtTokenUtil jwtTokenUtil=new JwtTokenUtil();
        System.out.println("开始登录");
        String token = jwtTokenUtil.generateToken("admin");
        System.out.println("token:"+token);
        redisTemplate.opsForValue().set("admin",token);
        return  token;
    }
    @RequestMapping("/filter/test")
    public String test(String test){
        return "test";
    }
    @RequestMapping("/test")
    public String test1(){
        return "test1";
    }
}
